package com.hopu.blb_erp.controller;


import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.hopu.blb_erp.entity.Department;
import com.hopu.blb_erp.entity.Staff;
import com.hopu.blb_erp.service.IStaffService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author A-Zhang
 * @since 2021-11-17
 */
@Api
@Controller
@RestController
public class StaffController {
    @Autowired
    private IStaffService staffService;

    @ApiOperation("查询某个部门中所有的员工")
    @GetMapping("/staffs/{id}")//传入的是前端选择的订单id
    public ResponseEntity<List<Staff>> findStaffByDepartmentId(@PathVariable("id") String id ){
        List<Staff> staffList = staffService.list();
        return ResponseEntity.ok(staffList);
    }
}
